<?php
require_once "../../../libs/ttServer.php";

$tt = new ttServer();

//define('securePOST', 'secureGET');

if ($tt->session->is_login())
{

	$uid = $tt->session->user['uid'];
	$start_date = secureGET("start_date");
	$state_type = secureGET("state_type");
	$target = secureGET("target");
	$service = secureGET("service");
	$comment = secureGET("comment");	
	
	if (!is_numeric($service) || !is_numeric($state_type))
	{
		echo FormatAPIOutput($tt->please_check_parameters());
	}
	else
	{
		echo FormatAPIOutput($tt->add_travel_state($uid, $start_date, $state_type, $target, $service, $comment));
	}
}
else
{
	echo FormatAPIOutput($tt->session->please_login());
}


?>